package com.mzj.saas.jobs.pwd.executor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mzj.saas.jobs.pwd.service.TempPwdService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;

/**
 * 承租人临时密码
 */
@JobHandler(value = "tempPwdExecutor")
@Component
public class TempPwdExecutor extends IJobHandler {
	private static Logger log = LoggerFactory.getLogger(TempPwdExecutor.class);

	@Autowired
	private TempPwdService tempPwdService;

	@Override
	public ReturnT<String> execute(String arg0) throws Exception {
		long time = System.currentTimeMillis();

		String result = tempPwdService.work();

		long useTime = System.currentTimeMillis() - time;
		log.info("----> TempPwdExecutor end, result: {}, use time: {}", result, useTime);

		return SUCCESS;
	}
}
